package com.jintu.portal.repository.mongo.apply;

import com.jintu.portal.pojo.entity.mongo.ApplyInfo;
import com.jintu.portal.repository.mongo.AbstractMongoDao;
import com.jintu.portal.utils.CommonUtil;
import org.springframework.stereotype.Repository;


/**
 * @author very
 */
@Repository("applyInfoDao")
public class ApplyInfoDao extends AbstractMongoDao<ApplyInfo> {

    public void saveApplyInfo(ApplyInfo applyInfo) {
        save(applyInfo);
    }

    public ApplyInfo selectApplyInfo(String id){
        ApplyInfo applyInfo = queryById(id,ApplyInfo.class);
        return applyInfo;
    }

    public void deleteApplyInfoByOrderId(String orderId, Integer userId){
        String id = CommonUtil.genMongoId(orderId, userId);
        deleteById(id, ApplyInfo.class);
    }
}
